package com.msmall.community.weather.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Weather implements Serializable{

	private static final long serialVersionUID = -5921636426264016821L;

	/**
	 * 中文名称
	 */
	private String name;
	/**
	 * 城市所在省名称
	 */
	private String province;
	
	/**
	 * 行政区划码
	 */
	private String cityCode;
	/**
	 * 城市名称
	 */
	private String city; 
	/**
	 * 城市码
	 */
	private String postalCode;
	/**
	 * 城市所在维度
	 */
	private String latitude;
	/**
	 * 城市所在经度
	 */
	private String longitude;
	/**
	 * 天气日期
	 */
	private Date date;
	
	/**
	 * 
	 */
	private Date currentDateTime; //TODO UNKNOW
	
	/**
	 * 天气描述
	 */
	private String condition;
	/**
	 * 最高温度
	 */
	private String tempf;
	/**
	 * 最低温度
	 */
	private String tempc;
	/**
	 * 湿度
	 */
	private String humidity;
	/**
	 * 天气图片
	 */
	private String icon;
	/**
	 * 风力情况
	 */
	private String windCondition;
	/**
	 * 此数据从GOOGLE获得的时间。作用：计算当前时间与lastDate差， 如果大于1个小时，重新从GOOGLE获得
	 */
	private Date lastDate;
	
	private List<ForeCast> foreCasts;
	
	public void addForecast(ForeCast foreCast){
		if(foreCasts == null){
			foreCasts = new ArrayList<ForeCast>();
		}
		foreCasts.add(foreCast);
	}
	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getTempf() {
		return tempf;
	}

	public void setTempf(String tempf) {
		this.tempf = tempf;
	}

	public String getTempc() {
		return tempc;
	}

	public void setTempc(String tempc) {
		this.tempc = tempc;
	}

	public String getHumidity() {
		return humidity;
	}

	public void setHumidity(String humidity) {
		this.humidity = humidity;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getWindCondition() {
		return windCondition;
	}

	public String getCondition() {
		return condition;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}

	public void setWindCondition(String windCondition) {
		this.windCondition = windCondition;
	}

	public List<ForeCast> getForeCasts() {
		return foreCasts;
	}

	public void setForeCasts(List<ForeCast> foreCasts) {
		this.foreCasts = foreCasts;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCityCode() {
		return cityCode;
	}
	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}
	public Date getCurrentDateTime() {
		return currentDateTime;
	}
	public void setCurrentDateTime(Date currentDateTime) {
		this.currentDateTime = currentDateTime;
	}
	public Date getLastDate() {
		return lastDate;
	}
	public void setLastDate(Date lastDate) {
		this.lastDate = lastDate;
	}
	public String toString(){
		StringBuffer buffer = new StringBuffer();
		buffer.append(this.province).append("-")
			.append(this.city).append("-")
			.append(this.condition).append("-")
			.append(this.humidity).append("-")
			.append(this.icon);
		return buffer.toString();
	}
}
